﻿<%@ Page Title="" Language="C#" MasterPageFile="~/nest2.master" AutoEventWireup="true" CodeBehind="cd.aspx.cs" Inherits="WebApplication1.cd" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Panel ID="Panel1" runat="server">
    <br /><br />
    &nbsp;&nbsp;&nbsp;<asp:LinkButton ID="LinkButton1" runat="server" 
        PostBackUrl="~/Admin/addcd.aspx" Font-Names="Times New Roman" 
            Font-Size="Medium">Add New CD Details</asp:LinkButton>
        <br />
    <br />
    <br />
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        CellPadding="2" DataKeyNames="cdno" DataSourceID="SqlDataSource1" 
        AutoGenerateDeleteButton="True" AutoGenerateEditButton="True" 
        Height="235px" Width="710px" align="center">
        <AlternatingRowStyle BackColor="#003300" />
        <Columns>
            <asp:BoundField DataField="cdno" HeaderText="CD NO" ReadOnly="True" 
                SortExpression="cdno" />
            <asp:BoundField DataField="name" HeaderText="Name" SortExpression="name" />
            <asp:BoundField DataField="cat" HeaderText="Category" SortExpression="cat" />
            <asp:BoundField DataField="lang" HeaderText="Language" 
                SortExpression="lang" />
            <asp:BoundField DataField="publish" HeaderText="Publisher" 
                SortExpression="publish" />
            <asp:BoundField DataField="year" HeaderText="Year" 
                SortExpression="year" />
            <asp:BoundField DataField="copies" HeaderText="Copies" 
                SortExpression="copies" />
            <asp:BoundField DataField="price" HeaderText="Price" SortExpression="price" />
        </Columns>
        <EditRowStyle Font-Names="Times New Roman" Font-Size="Medium" />
        <HeaderStyle BackColor="#996633" Font-Names="Times New Roman" 
            Font-Size="Medium" />
        <RowStyle Font-Names="Times New Roman" Font-Size="Medium" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        SelectCommand="SELECT * FROM [cdinfo]"
        UpdateCommand="update cdinfo set copies=@copies"
        DeleteCommand="DELETE from cdinfo where cdno=@cdno">
    </asp:SqlDataSource>
    </asp:Panel>
    
</asp:Content>
